package cn.wuyu.baselibrary.utils;

import cn.wuyu.baselibrary.app.APPConfig;

/**
 * Toast统一管理类
 */
public class ToastUtil {
    private ToastUtil() {
        /* cannot be instantiated */
        throw new UnsupportedOperationException("cannot be instantiated");
    }
    
    /**
     *    switch (view.getId()) {
     case R.id.button_error_toast:
     RxToast.error(mContext, "这是一个提示错误的Toast！", Toast.LENGTH_SHORT, true).show();
     break;
     case R.id.button_success_toast:
     RxToast.success(mContext, "这是一个提示成功的Toast!", Toast.LENGTH_SHORT, true).show();
     break;
     case R.id.button_info_toast:
     RxToast.info(mContext, "这是一个提示信息的Toast.", Toast.LENGTH_SHORT, true).show();
     break;
     case R.id.button_warning_toast:
     RxToast.warning(mContext, "这是一个提示警告的Toast.", Toast.LENGTH_SHORT, true).show();
     break;
     case R.id.button_normal_toast_wo_icon:
     RxToast.normal(mContext, "这是一个普通的没有ICON的Toast").show();
     break;
     case R.id.button_normal_toast_w_icon:
     Drawable icon = getResources().getDrawable(R.drawable.set);
     RxToast.normal(mContext, "这是一个普通的包含ICON的Toast", icon).show();
     break;
     }
     */
    public static void show(String text) {
        RxToast.normal(AppUtil.getAppContext(), text).show();
//        Toast.makeText(AppUtil.getAppContext(), text, Toast.LENGTH_SHORT).show();
    }


    public static void show(int resId) {
        RxToast.normal(AppUtil.getAppContext(), ResUtils.getString(resId)).show();
//        Toast.makeText(AppUtil.getAppContext(), text, Toast.LENGTH_SHORT).show();
    }

    public static void showTest(String text) {
        if (APPConfig.DEBUG)
            RxToast.normal(AppUtil.getAppContext(), text).show();
//        Toast.makeText(AppUtil.getAppContext(), text, Toast.LENGTH_SHORT).show();
    }
}